window.onload = function () {
    let box = document.getElementById("box");
    let ulBox = document.getElementById("ul-box");

    console.log(ulBox.children.length);
    let count = 0;
    let num = 0;
    setInterval(() => {
        box.style.left = count + "px";
        count--;

        if (count < -3318) {
            count = 0;
        }
        if (count % 1106 == 0) {
            num++;
            for (let i = 0; i < ulBox.children.length; i++) {
                ulBox.children[i].style.borderBottom = "none"
            }
            if (num == ulBox.children.length) {
                num = 0
            }
            ulBox.children[num].style.borderBottom = "3px solid #e4087c"
            console.log(num);
        }

    }, 5);

}